package com.yangrd.helper.crudhelper.core.crud.page;

import org.springframework.core.Ordered;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Optional;

/**
 * @author yangrd
 * @date 2020/10/23
 */
public interface CrudPageRepository extends Ordered {

    /**
     * get
     * @param domainClass
     * @return
     */
    Optional<CrudPage> get(Class<?> domainClass);

    /**
     * put
     * @param domainClass
     * @param crudPage
     */
    void put(Class<?> domainClass, CrudPage crudPage);

    /**
     * delete
     * @param domainClass
     */
    void delete(Class<?> domainClass);

    /**
     * findAll
     * @param domain
     * @param pageable
     * @return
     */
    Page<CrudPage> findAll(String domain, Pageable pageable);
}
